package com.giscloud.limp.entity;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.ArrayList;
import java.util.Arrays;
/**
 * ${comments}
 * 
 * @author giscloud
 * @email giscloud@giscloud.com
 * @date 2020-06-10 19:33:46
 */
@Data
public class CompanyBlacklist implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 企业名单ID
	 */
   private Integer companyListId;
	/**
	 * 企业名称
	 */
   private String companyName;
	/**
	 * 统一社会信用代码
	 */
   private String uniformSocialCreditCode;
	/**
	 * 联系人
	 */
   private String contacts;
	/**
	 * 联系电话
	 */
   private String contactTel;
	/**
	 * 企业官网
	 */
   private String website;
	/**
	 * 企业邮箱
	 */
   private String email;
	/**
	 * 企业地址
	 */
   private String address;
	/**
	 * 企业logo
	 */
   private String companyLogo;
	/**
	 * 上报单位id
	 */
   private Integer reportOrgId;
	/**
	 * 上报单位名称
	 */
   private String reportOrgName;
	/**
	 * 黑名单入榜原因 字典值
	 */
   private Integer blacklistReason;

	/**
	 * 黑名单入榜原因 显示值
	 */
	private String blacklistReasonStr;

	/**
	 * 备注
	 */
   private String remark;
	/**
	 * 审核状态 0|待审核;1|审核通过;审核不通过
	 */
   private Integer auditStatus;
	/**
	 * 审核备注
	 */
   private String auditRemark;
	/**
	 * 状态 1|有效;2|删除
	 */
   private Integer statusCd;
	/**
	 * 创建人id
	 */
   private Integer createdStaffId;
	/**
	 * 创建时间
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date createdDt;
	/**
	 * 修改人id
	 */
   private Integer operateStaffId;
	/**
	 * 修改时间
	 */
   private Date version;
	/**
	 * 入榜日期
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date listDate;

public enum Column {
						companyListId("company_list_id","companyListId","INTEGER",false),
								companyName("company_name","companyName","VARCHAR",false),
								uniformSocialCreditCode("uniform_social_credit_code","uniformSocialCreditCode","VARCHAR",false),
								contacts("contacts","contacts","VARCHAR",false),
								contactTel("contact_tel","contactTel","VARCHAR",false),
								website("website","website","VARCHAR",false),
								email("email","email","VARCHAR",false),
								address("address","address","VARCHAR",false),
								companyLogo("company_logo","companyLogo","VARCHAR",false),
								reportOrgId("report_org_id","reportOrgId","INTEGER",false),
								reportOrgName("report_org_name","reportOrgName","VARCHAR",false),
								blacklistReason("blacklist_reason","blacklistReason","INTEGER",false),
								remark("remark","remark","VARCHAR",false),
								auditStatus("audit_status","auditStatus","INTEGER",false),
								auditRemark("audit_remark","auditRemark","VARCHAR",false),
								statusCd("status_cd","statusCd","INTEGER",false),
								createdStaffId("created_staff_id","createdStaffId","INTEGER",false),
								createdDt("created_dt","createdDt","TIMESTAMP",false),
								operateStaffId("operate_staff_id","operateStaffId","INTEGER",false),
								version("version","version","TIMESTAMP",false),
								listDate("list_date","listDate","DATE",false);
	    		private static final String BEGINNING_DELIMITER = "`";
	private static final String ENDING_DELIMITER = "`";
	private final String column;
	private final boolean isColumnNameDelimited;
	private final String javaProperty;
	private final String jdbcType;
	public String value() {
		return this.column;
	}
	public String getValue() {
		return this.column;
	}
	public String getJavaProperty() {
		return this.javaProperty;
	}
	public String getJdbcType() {
		return this.jdbcType;
	}
	Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
		this.column = column;
		this.javaProperty = javaProperty;
		this.jdbcType = jdbcType;
		this.isColumnNameDelimited = isColumnNameDelimited;
	}
	public String desc() {
		return this.getEscapedColumnName() + " DESC";
	}
	public String asc() {
		return this.getEscapedColumnName() + " ASC";
	}
	public static Column[] excludes(Column ... excludes) {
		ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
		if (excludes != null && excludes.length > 0) {
			columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
		}
		return columns.toArray(new Column[]{});
	}
	public String getEscapedColumnName() {
		if (this.isColumnNameDelimited) {
			return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
		} else {
			return this.column;
		}
	}
	public String getAliasedEscapedColumnName() {
		return this.getEscapedColumnName();
	}
  }

}
